/**
 * @author Luc Yriarte
 * 
 * Licence : BSD http://www.opensource.org/licenses/bsd-license.php
 *  
 */
package basicSim;

public class TransformList {

	public TransformList next;

	public Matrix transform;

	public int nStep, current;

	public TransformList() {
		next = null;
		transform = new Matrix3D();
		nStep = current = -1;
	}

	public TransformList(Matrix transform, int nStep) {
		next = null;
		this.transform = transform;
		this.nStep = current = nStep - 1;
	}

	public TransformList(Matrix transform, int nStep, TransformList next) {
		this.next = next;
		this.transform = transform;
		this.nStep = current = nStep - 1;
	}

	public TransformList next() {
		if (current < 0)
			return this;
		if (current == 0) {
			current = nStep;
			return next;
		}
		current--;
		return this;
	}

	public String toString() {
		return " [ " + transform.toString() + " step=" + nStep + " ] " + (next != null ? next.toString() : "\n");
	}
	
}
